Skip to content

Fix race in CloseResults that drops test failure events#3512

Open
sean- wants to merge 1 commit intothought-machine:masterfrom
sean-:fix-close-results-race
Open

Fix race in CloseResults that drops test failure events#3512
sean- wants to merge 1 commit intothought-machine:masterfrom
sean-:fix-close-results-race

Conversation

@sean-
Copy link
Copy Markdown
Contributor

@sean- sean- commented Mar 26, 2026

CloseResults could close the external results channel while forwardResults still had pending items to forward from the internal channel. This caused a send on closed channel panic that was silently recovered, dropping the result. On FreeBSD CI this manifested as shell_output_test failing because the test failure event was lost, leaving failedTargets empty and suppressing the detailed error output.

Fix by draining the internal channel before closing, and setting the external channel to nil after close so late arrivals are skipped rather than panicking.

@sean- sean- force-pushed the fix-close-results-race branch from 9275870 to ab59fcd Compare March 26, 2026 15:57
CloseResults could close the external results channel while
forwardResults still had pending items to forward from the internal
channel. This caused a "send on closed channel" panic that was silently
recovered, dropping the result. On FreeBSD CI this manifested as
shell_output_test failing because the test failure event was lost,
leaving failedTargets empty and suppressing the detailed error output.

Fix by draining the internal channel before closing, and setting the
external channel to nil after close so late arrivals are skipped
rather than panicking.
@sean- sean- force-pushed the fix-close-results-race branch from ab59fcd to f641f5b Compare March 26, 2026 16:10
@sean-
Copy link
Copy Markdown
Contributor Author

sean- commented Mar 26, 2026

The build-linux-alt failure is likely due to #3510 not being merged yet (which has the fix for the rate limit).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant